package de.mhus.lib.mandala;

import java.util.LinkedList;
import java.util.List;

public class Function extends Element {
	
	private LinkedList<Object> list = new LinkedList<Object>();
	
	
	public Function(Object ... items) {
		for (Object o : items)
			if (o != null) list.add(o);
	}
	
	/*
	 * Render the function incl. body.
	 */
	@Override
	protected void doRender(Response out) {
		out.print("function(data) {");
		UiUtil.renderAsFunctions(list, getWindow(), out);
		out.print("}");
		
	}
	
	public List<Object> getList() {
		return list;
	}

}
